<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport"/>
    <link rel="stylesheet" href="css/amazeui.min.css">
    <link rel="stylesheet" href="css/animate.min.css">
    <link rel="stylesheet" href="css/style.css">
    <title>评论</title>
</head>
<body>
<header data-am-widget="header"
        class="am-header am-header-default" style="background-color: #FF856E;">
    <div class="am-header-left am-header-nav">
        <a href="javascript:history.go(-1);" style="float: left">
            <i class="am-icon-chevron-left" style="font-size: 22px;color: white;"></i>
        </a>
        <span style="font-size: 18px;color: white;">评论订单</span>
    </div>

</header>

<div style="text-align: center;margin-top: 2%;">
    <h1 style="color: #A54848; font-weight: inherit;letter-spacing: 0.1em;margin-bottom: 2%;">给你我的心</h1>
    <hr style="width: 90%;margin: 2% auto;background-color: #757575;"/>
    <p style="font-size: 16px;margin-top: 2%;">给劳动人民一点点评吧！</p>
</div>

<div class="am-nav" style="width: 96%; margin: 5% auto;background-color: white;padding: 3%;">
    <div class="am-u-sm-12" style="margin-bottom: 2%;">
        <textarea placeholder="说说送手的优点和不足吧" id="commentsContent"
                  style="width: 100%;height: 100px;max-width: 100%;max-height: 100px;outline: none;color: #606060;"></textarea>
    </div>
    <hr style="width: 96%;margin:5% auto; background-color: #757575;" />
    <div class="am-u-sm-12" style="padding-right: 5%;">
        <img src="img/car.png" style="width: 32px;" alt="">
        <span style="margin-left: 5%;color: black;font-size: 16px;">送手评分：</span>
        <div id="star" style="float: right;"></div>
    </div>
    <button class="am-btn am-btn-sm am-btn-warning" id="createCommentsSubmit" type="button" style="margin-top: 10%;border-radius: 20px;float: right;margin-right: 5%;outline: none;">
        发&nbsp;&nbsp;&nbsp;&nbsp;布
    </button>
</div>


<script src="js/jquery.min.js"></script>
<script src="js/jquery.raty.js"></script>
<script src="js/main.js"></script>
</body>
<script>
    const orderId = UrlParm.parm("orderId");
    $("#star").raty();

    $("#createCommentsSubmit").click(function () {
        const comentsContent = $("#commentsContent").val();
        const star = $("input[name='score']").val();

        if (comentsContent != "" && star != "") {
            commentsOrder(orderId, comentsContent, star)
        }
    })


</script>
</html>